﻿using System;

namespace WebExamples
{
	public partial class WebUserControl1 : System.Web.UI.UserControl
	{
		public int PageSize { get { return Convert.ToInt32(ViewState["PageSize"]); } }

        protected void Page_Load(object sender, EventArgs e)
		{
			gridView.PageIndexChanged += new EventHandler(gridView_PageIndexChanged);

        	if (!IsPostBack)
        	{
				UpdateGridView(PageSize, gridView.PageIndex);
        	}
		}

		void gridView_PageIndexChanged(object sender, EventArgs e)
		{
			UpdateGridView(PageSize, gridView.PageIndex);
		}

		private void UpdateGridView(int size, int index)
		{
			//gridView.DataSource = MyService(size, Records, index);
			gridView.DataBind();
		}
	}
}